-
Notifications
You must be signed in to change notification settings - Fork 2
feat(DCP-2190): add collection publish command #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(DCP-2190): add collection publish command #289
Conversation
Add command to publish AI Task Builder Collections as studies. Creates a study with the collection content and transitions it to published state.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
…collection publish
ajmalkhan-eng
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 💪 ..
| if len(opts.Args) < 1 || opts.Args[0] == "" { | ||
| return errors.New("please provide a collection ID") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought.. if earlier we have cobraMinimumNArgs(1) us this additional check even required?
Summary
Add a new CLI command to publish AI Task Builder Collections as studies. This command creates a study from a collection's content and automatically transitions it to the published state, making it available to participants.
Collection Publish Command
Publish an AI Task Builder Collection as a study with a specified number of participants.
Flags
--participants-p--name-n--description-dOutput
Displays the created study details including ID, name, status, and the study URL for participants.
Implementation
DataCollectionMethodAITBCollectionconstant tomodel/study.gocmd/collection/publish.gowithNewPublishCommandcmd/collection/collection.godata_collection_method: AI_TASK_BUILDER_COLLECTIONTesting
Unit tests cover:
Note
Medium Risk
Touches study creation/publish flow and introduces template-driven input parsing, which can affect how requests are formed and published if field overrides/serialization behave unexpectedly.
Overview
Adds a new
collection publish <collection-id>CLI command that creates a study from an AI Task Builder Collection (participants required unless a JSON/YAML template is provided), then automatically transitions it toPUBLISHand prints the rendered study plus a study URL.When a template is used, the command forces
data_collection_method/data_collection_idto the target collection, clearsexternal_study_urlas incompatible, and lets CLI flags override template fields with sensible description fallbacks. This also introducesmodel.DataCollectionMethodAITBCollection, adds an example template JSON, and includes extensive unit coverage for success, error paths, and template/flag override behavior.Written by Cursor Bugbot for commit 0fd00f1. This will update automatically on new commits. Configure here.